%\vspace{-0.2cm}
%\subsection{Managing models with uncertainty}\label{sec:managing} 
%\vspace{-0.1cm}
%
%Mostrare gli operatori applicandoli ad esempio 
%
%Working with a single model containing uncertainty enables the designer to easily select one or more alternatives. In fact, the designer may choose to remove the uncertainty selecting the desired concretization model otherwise she may prefer to partial resolve uncertainty by limiting the alternatives. In general, this reduces the effort of managing a multitude of models. 
%

%However, a number of operation may be needed to give the designer a more effective support. 
%
%
%Starting from the uncertainty metamodel \emph{UMM} introduced in Section \ref{sec:UMM}, we define a model with uncertainty as following:
%
%\vspace{0,2cm}
%\noindent
%{\bf Model with uncertainty.} Let $SC =\{c_k | c \in Shared Classes\}$ a set of
%shared classes;  $UC=\{s_j | s \in Uncertainty Point\ and\  j=0..n  \}$ a set of n-uncertainty point and 
%$C_{j}=\{c_i | c \in Classes\ belong\ to\  UC_j and \ 0 \le i \le \mid UC_j\mid$ \footnote{For $\mid UC_j\mid$ we means the number of classes contained in $UC_j$} \} as the set of alternative classes belong to $UC_j$;  we define a model with uncertainty as
%$UM_{S} = SC \cup UC$. 
%
%
%\begin{figure*}[ht]
%   \center
%    \includegraphics[width=11cm]{figures/uncertainty_xmi.jpg}
%    \vspace{-0.2cm}
%    \caption{UHSMm model}
%    \vspace{-0.2cm}
%      \label{fig:UMHSM}
% \end{figure*}
%
%
%     
%     
%\noindent
%Furthermore, we defines the following operations:
%
%\vspace{0,2cm}
%\noindent
%{\bf concr.} The operation $concr$ takes as input a model containing uncertainty $UM_S$ and returns all the correspondent concretizations $M_S$. 
%
%\vspace{0.1cm} 
%$concr(UM_S) = M_S=\{SC,s | s \in (C_1XC_2X...XC_j)\}$
%
%\vspace{0.1cm} 
%\noindent 
%When a transformation is executed, the JTL engine deduces simultaneously both the model with uncertainty and the correspondent solution space. Since, starting from the model $UM_S$ (for instance, Figure \ref{fig:UHSM}) the models $M^*_S$ (for instance, left part of the Figure \ref{fig:HSM2SMmodels2}) are obtained by an automatic calculus of the transformation engine. 
%
%
%%The modified target model (\emph{SMm'}) is shown in the left part of the Figure \ref{fig:HSM2SMmodels2}, whereas the source models propagating the changes (\emph{HSMm'\_1}/\emph{2}/\emph{3}/\emph{4}), obtained by re-applying the \emph{HSM2SM} transformation, are depicted in Figure \ref{fig:HSM2SMmodels2}). For example, as visible in the property of the transition, \emph{HSMm'\_1} represents the case in which the transition is targeted to the composite state \code{Active}.
%
%
%\vspace{0.2cm}
%\noindent
%{\bf concr(e).} The operation $concr$ takes as input a model containing uncertainty $UM_S$ and a parameter $e$ representing one of the alternative solutions and returns the selected concretization $M^e_S$ according with $e$. 
%
%
%\vspace{0.1cm} 
%$ concr(UM_S,e) = M^{*}_{Se}=\{SC,c_{1e},c_{2e},...,c_{je}\}$
%
%%\vspace{0.2cm} 
%%$\forall M_S \in MM^*_S, \forall UM_S \in UMM_S \hspace{0.5cm} concr(e)(UM_S) = M^e_S, s.t. M^e_S \in M^i_S$
%
%\vspace{0.1cm} 
%\noindent 
%This operation works as a filter applied on the whole solution space. In particular, the designer selects a single solution for each point of uncertainty to resolve it in successive steps. Each selection is translated to an ASP constraint.
%For instance, the concretization model \emph{HSMm'\_1} in the left part of the Figure \ref{fig:HSM2SMmodels2}, in which the transition is targeted to the composite state \code{Active}, is directly selected by its identifier. In particular, the designer choice may be expressed by means of OCL constraint $s$
%
%\begin{lstlisting}[breaklines,style=AMMA,language=ASPencoding,mathescape,rulesepcolor=\color{black}, numbers=none]
%Transition.allInstances()->select(e:Transition | e.trace = '15,x/15')                         
%\end{lstlisting}
%\vspace{-0.2cm}  
%%which is translated to
%
%%\begin{lstlisting}[breaklines,style=AMMA,language=ASPencoding,mathescape,rulesepcolor=\color{black}, numbers=none]
%%:- node(HSM, IDT, transition), IDT != '15,x/15'.               
%%\end{lstlisting}
%
%
%
%\vspace{0.2cm}
%\noindent
%{\bf concr(p).} The operation $concr(p)$ takes as input a model containing uncertainty $UM_S$ and a parameter $p$ returns all the correspondent concretizations $M^i_S$ according with $p$. $p$ give place to a constraint that if applied on the whole set of concretization models returns a subset of it.  
%
%\vspace{0.1cm} 
%$concr(UM_S,p) = M^*_{Sp}=\{SC,C_{1p}XC_{2p}X...XC_{jp} \ s.t.\ \forall 0\le i \le j \ C_{ip}\subseteq C_i \}$
%
%%\vspace{0.2cm} 
%%$\forall M_S \in MM^*_S, \forall UM_S \in UMM_S \hspace{0.5cm} concr(p)(UM_S) = M^i_{S, i= 1..m, m \leq n}$
%
%\vspace{0.1cm} 
%\noindent 
%Even in this case, a filter is applied on the whole solution space.
%For instance, the OCL constraint $p$ 
%
%\begin{lstlisting}[breaklines,style=AMMA,language=ASPencoding,mathescape,rulesepcolor=\color{black}, numbers=none]    
%Transition.allInstances()->collect(e | e.transitions)->select(e:Transition | e.source.isInstanceOf( CompositeState ))                         
%\end{lstlisting}
%  
%%is translated to
%
%%\begin{lstlisting}[breaklines,style=AMMA,language=ASPencoding,mathescape,rulesepcolor=\color{black}, numbers=none]
%%:- node(HSM, IDT, transition), node(HSM, IDS, state), edge(HSM, IDR, source, IDT, IDS);                               
%%\end{lstlisting}
%
%It filter the solution space by eliminating all the solution not involving a composite state as source of a transition. Even in this case, the 
%the concretization model \emph{HSMm'\_1} in the left part of the Figure \ref{fig:HSM2SMmodels2} is given as output.
%
%
%\vspace{0,2cm}
%\noindent
%{\bf filter(p).} The operation $filter(p)$ takes as input a model containing uncertainty and a parameter $p$ returns another model containing uncertainty according with $p$. $p$ give place to a constraint that if applied on the original model returns a subset of it such that if a $concr$ is applied on it, all the correspondent concretizations that satisfy $p$ are obtained.
%
%\vspace{0.1cm} 
%$ filter(UM_S,p) = UM_{Sp} \subseteq UM_S$
%
%%M^i_{S, i= 1..n, m \leq n}$
%
%\vspace{0.1cm} 
%\noindent 
%This operation reduce the alternatives contained in each point of uncertainty. 
%For instance, considering the above showed constraint $p$ 
%
%\begin{lstlisting}[breaklines,style=AMMA,language=ASPencoding,mathescape,rulesepcolor=\color{black}, numbers=none]
%Transition.allInstances()->collect(e | e.transitions)->select(e:Transition | e.source.isInstanceOf( CompositeState ))                              
%\end{lstlisting} 
%%it is translated to
%
%%\begin{lstlisting}[breaklines,style=AMMA,language=ASPencoding,mathescape,rulesepcolor=\color{black}, numbers=none]
%%:- node(UHSM, IDT, utransition), edge(UHSM, IDUR, transitions, IDT, IDT1), node(UHSM, IDT1, transition), node(UHSM, IDS, state), edge(UHSM, IDR, source, IDT1, IDS).                             
%%\end{lstlisting}
%
%It means that the same constraint $p$, applied to the model with uncertainty, filters the alternatives eliminating all the solution not involving a composite state as source of a transition. For instance, in Figure \ref{fig:UHSM}) is modified by eliminating the alternative transition \code{print} of the point of uncertanty \code{UTransition} which not involve a composite state as source.  As a consequence, the correspondent concretization model is represented by the model \emph{HSMm'\_1} in the left part of the Figure \ref{fig:HSM2SMmodels2}.
%
%In order to enhance the usability of these operations, we plan to extend the framework with a wizard helping the architect to make decisions among proposed design alternatives.
% 